// 预加载脚本 运行在渲染进程之前
const { contextBridge,ipcRenderer } = require('electron');
console.log('preload');

contextBridge.exposeInMainWorld('myelectron', {
    versions: process.versions,
    saveFile:(data)=>{
        ipcRenderer.send('save-file',data)
    },
    readFile:()=>{
       const res = ipcRenderer.invoke('read-file')
      return res
    }
});